package com.luojialong.resultVo;

import com.luojialong.enums.AffairStatus;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 通用返回类
 * @param <T>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResultResponse<T> implements Serializable {
    private static final long serialVersionUID = -124435424848174343L;

    private Integer code;

    private T data;

    private String message;

    private String description;

    public ResultResponse(AffairStatus affairStatus) {
        this(affairStatus.getCode(),null,affairStatus.getText(),null);
    }


    public ResultResponse(AffairStatus affairStatus,String description) {
        this(affairStatus.getCode(),null,affairStatus.getText(),description);
    }

    public ResultResponse(AffairStatus affairStatus,T t) {
        this(affairStatus.getCode(),t,affairStatus.getText(),null);
    }


}
